package opgave1;

public class Identifier implements IdentifierInterface {

	private StringBuffer data;
	
	public Identifier () {
		data = new StringBuffer();
		data.append('a');
	}
	
	public Identifier (Identifier src) {
		data = new StringBuffer(src.data);
	}
	
	public void init(char c) {
		data = new StringBuffer();
		data.append(c);
	}
	
	public String read() {
		return data.toString();
	}

	public boolean equals(Identifier ident) {
		return data.toString().compareTo(ident.data.toString()) == 0;
	}

	public char getChar(int n) {
		return data.charAt(n);
	}
	
	public void addChar(char c) {
		data.append(c);
	}

	public int size() {
		return data.length();
	}
}
